package miblab.school;



import miblab.school.maps.Cluster;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.PowerManager;
import android.view.View;
import android.widget.Button;



public class LocationOptions extends Activity {
	private PowerManager.WakeLock wl;
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.locationoptions);

		//**********************Initialize Location Variables*******************************		

		Button automatic = (Button) findViewById(R.id.button1);
		Button address = (Button) findViewById(R.id.button2);
		Button atloc = (Button) findViewById(R.id.button3);

		PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
		wl = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "My Tag");
		wl.acquire();
		   

		//**********************Home Button Listener ****************************************		
		automatic.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {

				Intent intent = new Intent(LocationOptions.this,Cluster.class);
				intent.putExtra("EXTRA_FILENAME",SystemParameters.path+"/School/May 1, 2012.txt");
				intent.putExtra("EXTRA_DIFF",false);
				intent.putExtra("EXTRA_INT",0);
				startActivity(intent);


			}
		});

		//**********************School Button Listener ****************************************			
		address.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {

				Intent intent = new Intent(LocationOptions.this,SetAdress.class);
				startActivity(intent);
			}
		});

		//**********************School Button Listener ****************************************	
		atloc.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {

				Intent intent = new Intent(LocationOptions.this,SetLoc.class);
				startActivity(intent);
			}
		});  


	}
	//**********************On Pause ******************************************************		
	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
		wl.release();
		finish();
	}
	@Override
	public void onBackPressed() {
		//Log.d("CDA", "onBackPressed Called");
		Intent intent = new Intent(LocationOptions.this,ScreenSchoolActivity.class);
		startActivity(intent);
	}

}